<?php
namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class LongRent extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;
    
    protected $type = [
        'back_time'  =>  'timestamp:Y-m-d H:i:s',
        'deposit_time' =>  'timestamp:Y-m-d',
        'expire_time'=>  'timestamp:Y-m-d',
        'contract_time'=>  'timestamp:Y-m-d',
        'dispatch_time'=>  'timestamp:Y-m-d'
    ];
    
    
    public function agency()
    {
        return $this->hasOne('Agency','id','agency_id')->field('id,name');
    }
    
    public function user()
    {
        return $this->hasOne('User','id','user_id')->field('id,name');
    }
    
    public function brand()
    {
        return $this->hasOne('Brand','id','brand_id')->field('id,name');
    }
    
    
}